package com.zg.autoflow.dao.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zg.autoflow.req.SettleWorkflowBackApprovalPageReq;
import com.zg.autoflow.req.WorkflowInstanceReq;
import com.zg.autoflow.req.processListReq;
import com.zg.autoflow.vo.SettleBizformPdfVo;
import com.zg.autoflow.vo.SettleWorkflowBackApprovalVo;
import com.zg.autoflow.vo.SettleWorkflowInstanceVo;
import com.zg.autoflow.vo.WorkflowInstanceVo;
import com.zg.common.core.dao.autoflow.entity.SettleBizform;
import com.zg.common.core.dao.autoflow.entity.SettleWorkflowBackApproval;
import com.zg.common.core.dao.autoflow.entity.SettleWorkflowInstance;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface WorkflowInstanceMapper {

    IPage<WorkflowInstanceVo> getTodoWorkflowInstancePage(Page page, @Param("req") WorkflowInstanceReq workflowInstanceReq);

    Map<String, Object>  getFormData(@Param("tableName")String tableName, @Param("id")Long id);

    List<SettleBizform> selectLastBizFrom(@Param("inst_code") String inst_code, @Param("form_model_code") String form_model_code, @Param("id") Long id);

    List<Map<String, String>>  selectLastPdf(@Param("inst_code") java.lang.String inst_code, @Param("form_model_code") java.lang.String form_model_code);

    IPage<SettleWorkflowBackApprovalVo> getBackApprovalPage(Page page, @Param("req") SettleWorkflowBackApprovalPageReq workflowInstanceReq);

    Map<String, Object> isStepInstBySCGS(@Param("instCode")String instCode, @Param("stepInstCode")String stepInstCode);

    List<SettleBizformPdfVo> pdfFileSCGSList(@Param("instCode")String instCode, @Param("stepCode") String stepCode, @Param("isStepUser") String isStepUser);

    List<SettleBizformPdfVo> getPdfFileListByInstCode(@Param("inst_code") String inst_code,@Param("step_code") String step_code,@Param("isStepUser") String isStepUser);

    List<Map> getPDFPath(@Param("inst_code") String inst_code);


    List<String> getSettleWorkflowStepInstUser(@Param("flowInstCode") String flowInstCode, @Param("stepInstCode") String stepInstCode);

    IPage<SettleWorkflowInstanceVo> getCurrentUserProcessList(Page page,  @Param("req")processListReq paramMap);

    IPage<WorkflowInstanceVo> getTodoWorkflowInstanceEndPage(Page page, @Param("req") WorkflowInstanceReq workflowInstanceReq);

    List<SettleBizformPdfVo> getFrontFlowList(@Param("preInstCode")List<String> preInstCode, @Param("flowCodeFormId")List<String> flowCodeFormId,@Param("dbType")String dbType);
}
